using System;
using System.Collections;
using System.Collections.Generic;
using JetBrains.Annotations;
using UnityEngine;

public class Teleport : MonoBehaviour
{
    public TeleportTiggerArea G1;
    public TeleportTiggerArea G2;
    public Transform G1Outport;
    public Transform G2Outport;
    public GameObject player;

    private void Awake( )
    {
        player = GameObject.FindWithTag("Player");
    }

    private void Update( )
    {
        if ( G1.isEnter && !G2.isEnter )
        {
            player.transform.position = G1Outport.position;
        }
        if ( !G1.isEnter && G2.isEnter )
        {
            player.transform.position = G2Outport.position;
        }

    }
}
